package org.glut.cloud.materialManage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.glut.cloud.materialManage.entity.MaterialPurchases;

import java.util.List;

/**
 * 材料采购表 服务类接口
 *
 * @author sanminzhi
 * @since 2024-07-19 11:26
 */
public interface IMaterialPurchasesService extends IService<MaterialPurchases> {

    /**
     * 申请购买物料
     * @param
     * @return 一条申请记录
     */
    MaterialPurchases saveMaterialPurchases(MaterialPurchases materialPurchases);

    List<MaterialPurchases> getPurchases();

    boolean agreePurchase(MaterialPurchases materialPurchases);

    boolean rejectPurchase(MaterialPurchases materialPurchases);

    List<MaterialPurchases> getRecentAgreedPurchases();

    void updateMaterialQuantity(String materialName, int quantity);
}
